/**
 * 
 */
package com.thor.palmmall.rest.common;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.common.ASourceBill;
import com.thor.palmmall.spi.basic.SSourceBill;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class ASourceBillConverter implements Converter<SSourceBill, ASourceBill> {

  public static ASourceBillConverter getInstance() {
    if (instance == null)
      instance = new ASourceBillConverter();
    return instance;
  }

  private static ASourceBillConverter instance;

  private ASourceBillConverter() {
  }

  @Override
  public ASourceBill convert(SSourceBill source) {
    if (source == null) {
      return null;
    }
    ASourceBill target = new ASourceBill();
    target.setBillNumber(source.getBillNumber());
    target.setBillType(source.getBillType());
    target.setUuid(source.getUuid());
    return target;

  }
}
